/* 
 * File:   project_editor_dialog.cpp
 * Author: jolo
 * 
 * Created on: 13. Oktober 2011, 15:07
 * Lincense: New BSD License (The BSD 2-Clause License)
 */

#include "project_editor_dialog.hpp"

#include <QtGui/QLayout>

#include "project_editor.hpp"
#include "widgets/labelled_line_edit.hpp"

#include <model/project.hpp>

namespace gui
{

    project_editor_dialog::project_editor_dialog(model::project_ptr e, QWidget* p)
    : widgets::editor_dialog(e, p)
    {
        layout()->addWidget(create_editor());
        layout()->addWidget(create_buttons());
    }

    project_editor_dialog::~project_editor_dialog()
    {
    }
    
    void project_editor_dialog::accept() {
        done(QDialog::Accepted);
    }
    
    void project_editor_dialog::reject() {
        done(QDialog::Rejected);
    }
    
    widgets::data_editor* project_editor_dialog::create_editor() {
        set_editor(new gui::project_editor(dynamic_pointer_cast<model::project>(entity()), this));
        return editor();
    }
}